﻿namespace Agile.Service.Admin.WebApi.Controllers;

/// <summary>
/// 系统系统日志服务接口
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class SysLogController : AgileControllerBase
{
    /// <summary> 查询登录日志 </summary> 
    [HttpPost]
    public async Task<ResponseResult<PageModel<QueryPageSysLoginLogResponse>>> QueryPageLoginLog(QueryPageSysLoginLogRequest request)
    => Result(await this.GetService<ISysLoginLogService>().QueryPageAsync(request));

    /// <summary> 查询操作日志 </summary> 
    [HttpPost]
    public async Task<ResponseResult<PageModel<QueryPageSysOperationLogResponse>>> QueryPageOperationLog(QueryPageSysOperationLogRequest request)
    => Result(await this.GetService<ISysOperationLogService>().QueryPageAsync(request));

    /// <summary> 查询http日志 </summary> 
    [HttpPost]
    public async Task<ResponseResult<PageModel<QueryPageSysHttpLogResponse>>> QueryPageHttpLog(QueryPageSysHttpLogRequest request)
    => Result(await this.GetService<ISysHttpLogService>().QueryPageAsync(request));

    /// <summary> 查询http明细 </summary> 
    [HttpGet]
    public async Task<ResponseResult<SysHttpLogModel>> GetHttpLog(long logID)
    => Result(await this.GetService<ISysHttpLogService>().GetAsync(logID));
}
